#include <iostream>
using namespace std;
#include <queue>

//queue 队列容器 队头 对尾  先进先出

void test1()
{
        queue<int> q;
        q.push(1);
        q.push(2);
        q.push(3);

        cout<<"队头元素: "<<q.front()<<endl;
        cout<<"队列的大小: "<<q.size()<<endl;
        while (!q.empty())
        { 
                cout<<q.front()<<" ";
                q.pop();
        }
        cout<<endl;
}

class Teacher
{
public:
        int age;
        char name[32];
public:
        void printT()
        {
                cout<<"age: "<<age <<endl;
        }
};

void test2()
{
        Teacher t1, t2, t3;
        t1.age = 31;
        t2.age = 32;
        t3.age = 33;

        queue<Teacher> q;
        q.push(t1);
        q.push(t2);
        q.push(t3);

        while (!q.empty())
        {
                Teacher tmp = q.front();
                tmp.printT();
                q.pop();
        }  
}

void test3()
{
        Teacher t1, t2, t3;
        t1.age = 31;
        t2.age = 32;
        t3.age = 33;

        queue<Teacher *> q;
        q.push(&t1);
        q.push(&t2);
        q.push(&t3);

        while (!q.empty())
        {
                Teacher *tmp = q.front();
                tmp->printT();
                q.pop();
        }  
}

int main(int argc, char const *argv[])
{
       // test1();
        //test2();
        test3();
        return 0;
}
